const mysql = require('mysql')
const DBCOMFIG = require('../config/dbconfig')

const connection = mysql.createConnection({
   host: DBCOMFIG.HOST,
   user: DBCOMFIG.USER,
   password: DBCOMFIG.PASSWORD,
   database: DBCOMFIG.DATABASES,
   multipleStatements: true // 一次性执行多条sql语句
})
connection.connect()

// 导出数据库
module.exports = connection